public class HF_ClientWSAccountAdd{
    
@future (callout=true)
    public static void AddAccountAddress(set<Id> addset) {
          string outputresult;
          List<Account_Address__c> addList = new List<Account_Address__c>([select Id,NameId__c,Account_PIMS_Id__c,Address_Type_Code__c,Preferred_Flag__c,State_Name__c,County_Name__c,Country_Name__c,City__c,Street__c,Address_Line_1__c,Address_Line_2__c,Zipcode__c,  Zipcode_Extn__c,Comments__c,StatusCode__c from Account_Address__c where ID In: addset]); 
          WebServiceFinal4.BasicEndpoint s = new WebServiceFinal4.BasicEndpoint();
          for(Account_Address__c add: addList){
            
          //Stores AccountAddress details in AddressWrapper for Insert
                WebServiceFinal2.AddressWrapper c=new WebServiceFinal2.AddressWrapper();
                    c.AddressLine1=add.Address_Line_1__c;
                    c.AddressLine2=add.Address_Line_2__c;
                    c.AddressType=add.Address_Type_Code__c;
                    c.City=add.City__c;
                    c.Comments=add.Comments__c;
                    c.Country=add.Country_Name__c;
                    c.County=add.County_Name__c;
                    c.DataOn=system.DateTime.Now();
                    c.NameID = 0;
                    c.PartnerContactID=add.Account_PIMS_Id__c;    
                    c.PreferredAddress=add.Preferred_Flag__c;
                    c.SfdcAddressID= add.Id;
                    c.State=add.State_Name__c;
                    c.status=add.StatusCode__c;
                    c.StreetAddress=add.Street__c;
                    c.ZipCode=add.Zipcode__c;
                    c.ZipCodeExtension=add.Zipcode_Extn__c;
        try
        {
             outputresult=s.AddAccountAddress(c);
             system.debug('#######'+outputresult);
        }
        catch(Exception ex)
          {
            system.debug('output from webservice: '+ex);       
          }
       }       
 } 
        
        
@future (callout=true)
  public static void UpdateAccountAddress(set<Id> addset) {
      string outputresult;
      List<Account_Address__c> addList = new List<Account_Address__c>([select Id,Account__r.Partner_ID__c,NameId__c,Address_Type_Code__c,Preferred_Flag__c,Account_PIMS_Id__c,County_Name__c,State_Name__c,Country_Name__c,City__c,Street__c,Address_Line_1__c,Address_Line_2__c,Zipcode__c,Zipcode_Extn__c,Comments__c,StatusCode__c from Account_Address__c where ID In: addset]); 
      WebServiceFinal4.BasicEndpoint s = new WebServiceFinal4.BasicEndpoint();
      for(Account_Address__c add: addList){
                
      //Stores AccountAddress details in AddressWrapper for Update
            WebServiceFinal2.AddressWrapper c=new WebServiceFinal2.AddressWrapper();
                c.AddressLine1=add.Address_Line_1__c;
                c.AddressLine2=add.Address_Line_2__c;
                c.AddressType=add.Address_Type_Code__c;
                c.City=add.City__c;
                c.Comments=add.Comments__c;
                c.Country=add.Country_Name__c;
                c.County=add.County_Name__c;
                c.DataOn=system.DateTime.Now();
                c.NameID=0;
                c.PartnerContactID=add.Account_PIMS_Id__c;
                c.PreferredAddress=add.Preferred_Flag__c;
                c.SfdcAddressID= add.Id;
                c.State=add.State_Name__c;
                c.status=add.StatusCode__c;
                c.StreetAddress=add.Street__c;
                c.ZipCode=add.Zipcode__c;
                c.ZipCodeExtension=add.Zipcode_Extn__c;
                
        try
        {
             outputresult=s.UpdateAccountAddress(c);
             system.debug('#######'+outputresult);
        }
        catch(Exception ex)
          {
             system.debug('output from webservice: '+ex);       
          }
        }       
    }  
      
}